<!-- golf -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
<?=$title?>
</title>
<link rel="stylesheet" href='<?=base_url()?>css/960.css' type="text/css" />
<link rel="stylesheet" href='<?=base_url()?>css/text.css'  type="text/css" />
<link rel="stylesheet" href='<?=base_url()?>css/reset.css' type="text/css" />
<link rel="stylesheet" href='<?=base_url()?>css/km.css' type="text/css" />
<link id="page_favicon" href="<?=base_url()?>favicon.ico" rel="icon" type="image/x-icon" />

<script src="<?=base_url()?>js/jquery-1.4.3.min.js" type="text/javascript"></script>
<script src="<?=base_url()?>js/img-rotator.js" type="text/javascript"></script>
<link rel="stylesheet" href='<?=base_url()?>css/img-rotator.css' type="text/css" />

</head>
<body style="background-color:#f2f2f2;">
<!-- google translate -->
<script>
function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: 'th',
    includedLanguages: 'en',
    multilanguagePage: true,
    floatPosition: google.translate.TranslateElement.FloatPosition.TOP_RIGHT
  });
}
</script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

<!--container-->
<div class="container_12" style="margin-top:45px;">
<!--logo-->
<div class="grid_9"><a href="<?=base_url()?>"><img src="images/knowledge_03.png" border="0" /></a></div>
<div class="grid_3" id="nav-ico-menu"><a href="<?=base_url()?>"> <img src="images/home.gif" border="0" /></a> &nbsp;<img src="images/user.gif" /> &nbsp;<img src="images/search.gif" /> &nbsp;<img src="images/question.gif" /></div>
<div class="clear"></div>
<!--end logo-->
<!--nav-menu-->
<div class="grid_12" id="nav-menu">
  <ul>
    <li><a href="<?=base_url()?>">Home</a></li>
    <li><a href="<?=base_url()?>organization/">Organization</a></li>
    <li><a href="<?=base_url()?>blog/">Blog</a></li>
    <li><a href="<?=base_url()?>cops/">CoPs</a></li>
    <li><a href="<?=base_url()?>search/">Search</a></li>
    <li><a href="<?=base_url()?>statistics/">Statistics</a></li>
    <li><a href="<?=base_url()?>about/">About</a></li>
  </ul>
</div>
<div class="clear"></div>
<!--end-nav-menu-->

<!--banner-->
<div class="grid_12">
    <div class="folio_block">
        <div class="main_view">
            <div class="window">	
                <div class="image_reel">
                    <img src="<?=base_url()?>images/promo/reel_1.jpg" alt="" />
                    <img src="<?=base_url()?>images/promo/reel_2.jpg" alt="" />
                    <img src="<?=base_url()?>images/promo/reel_3.jpg" alt="" />
                    <img src="<?=base_url()?>images/promo/reel_4.jpg" alt="" />
                </div>
            </div>
            <div class="paging">
                <a href="#" rel="1">1</a>
                <a href="#" rel="2">2</a>
                <a href="#" rel="3">3</a>
                <a href="#" rel="4">4</a>
            </div>
        </div>
	</div>
</div>
<div class="clear"></div>
<!--end banner-->

<!--navigator-->
<div class="grid_12" style="background-color:#BEBEBE; font-size:x-small; color:#333333; padding-top:5px; padding-bottom:5px;">&nbsp;&nbsp;&nbsp;&nbsp;<a href="<?=base_url()?>">Main Page:</a><?=$navigator?></div>
<div class="clear"></div>
<!--end navigator-->
<!--content1-->
<div class="grid_12" style="background-color:#CCCCCC;">

<!-- user panel -->
  <div class="grid_4 alpha" style="margin-top:10px;">
    <?php
	$is_logged_in = $this->session->userdata('is_logged_in');
	if(!isset($is_logged_in) || $is_logged_in != true){
      ?>
    <div id="user-panel-top"></div>
    <div id="user-panel-middle">
      <p><img src="<?=base_url()?>images/graphic/user-silhouette-question.png" alt="member login"/>&nbsp;Member Login</p>

      <form method="post" action="<?=base_url()?>logon/validate_credentials">
        <label>Username</label>
        <br/>
        <label>
        <input type="text" name="username" class="username"/>
        </label>
        <br/>
        <label>Password</label>
        <br/>
        <label>
        <input type="password" name="password" class="password"/>
        </label>
        <br/>
        <label>
        <input type="submit" value="Login"/>
        </label>
      </form>
      <label>&#8250;&nbsp;
      <a href="<?=base_url()?>logon/signup">Create Account ?</a>
      </label>
    </div>
    <div id="user-panel-bottom"></div>
    <?php
	}
	else{
      ?>
    <div id="user-panel-top"></div>
    <style type="text/css">
<!--
#avatar img{
	border: medium solid #F7F7F7;
}
-->
</style>
    <div id="user-panel-middle" style="position:relative;">
      <?php
	  $this->db->where('username',$this->session->userdata('username'));
	  $query = $this->db->get('membership');
		foreach($query->result() as $rows){
			$firstname = $rows->firstname;
			$lastname = $rows->lastname;
			$member_display = $rows->member_display;
			$nickname = $rows->nickname;
		}
	?>
      <p><img src="<?=base_url()?>images/graphic/user_business.png" alt="member login"/>&nbsp;Member Panel</p>
      <br/>
      <?php 
if($member_display == NULL)
{
	?>
	<div id="avatar"><img src="<?=base_url()?>km_resource/member_display/null.png" width="60" height="60"/></div>
	<br/>
	<?php
}
else
{
?>
	<div id="avatar"><img src="<?=base_url()?>km_resource/member_display/<?=$member_display?>" width="60" height="60"/></div>
	<br/>
<?php
}
?>
      <div id="member_areas" style="position:absolute; left:100px; top:35px;">
      <?=$firstname?>&nbsp;<?=$lastname?>
      </label>
      <br/>
      <br/>
      <label>&#8250;&nbsp;<a href="<?=base_url()?>site/member">Edit Profile</a></label>
      <br/>
      <label>&#8250;&nbsp;<a href="<?=base_url()?>blog/read/<?=$nickname?>">View Blog</a></label>
	</div>
    <div id="logout_but" style="position:absolute; top:120px;">
    <a href="<?=base_url()?>logout" style="border:none; background: #ED0C66; -moz-border-radius: 4px; -webkit-border-radius: 4px; padding:5px;
        color:#FFFFFF;
    box-shadow: 0 1px 0 white;
	-moz-box-shadow: 0 1px 0 white;
	-webkit-box-shadow: 0 1px 0 white;
	text-decoration:none;">Logout</a>
    </div>
    </div>
    <div id="user-panel-bottom"></div>
    <?php
	}
      ?>
      <!-- end user panel-->
      
      <!-- km category-->
      <div class="grid_4 alpha" style="margin-top:8px;">
    <div id="side-panel-top">
      <div id="topic">KM Category</div>
    </div>
    <div id="side-panel-middle"><a href="<?=base_url()?>organization/"><img src="<?=base_url()?>images/etc/organization_link.png" /></a><br/>
      <a href="<?=base_url()?>blog/"><img src="<?=base_url()?>images/etc/blog_link.png" /></a><br/>
      <a href="<?=base_url()?>cops/"><img src="<?=base_url()?>images/etc/cops_link.png" /></a></div>
    <div id="side-panel-bottom"></div>
  </div>
  <!-- end km category -->
  
  <!--  km tool's -->
  <div class="grid_4 alpha" style="margin-top:8px;">
  <div id="side-panel-top">
    <div id="topic">Menu</div>
  </div>
  <div id="side-panel-middle">
    <ul  style="list-style:none;">
      <li><img src="<?=base_url()?>images/graphic/application-form.png"/> <a href="logon/signup">Create Account</a></li>
      <li><img src="<?=base_url()?>images/graphic/question-balloon.png"/> Faq</li>
      <li><img src="<?=base_url()?>images/graphic/rss.png"/> RSS/Feed</li>
      <li><img src="<?=base_url()?>images/graphic/user_business.png"/> <a href="<?=base_url()?>administrator">Administrator</a></li>
    </ul>
  </div>
  <div id="side-panel-bottom"></div>
</div>
<!-- end km tool's -->

  <!--  km tool's -->
  <div class="grid_4 alpha" style="margin-top:8px;">
  <div id="side-panel-top">
    <div id="topic">Member Register</div>
  </div>
  <div id="side-panel-middle">
  	 <!--display member-->
                <div id="all_member" style="padding-left:10px;">
                	<table border=\"0\"  cellspacing=\"1\" cellpadding=\"1\">
                    <tr>
                	<?php
						$initrows=0;
						//query member of group.
						$this->db->order_by('member_id','desc');
						$q_show_member = $this->db->get('membership');
						foreach($q_show_member->result() as $q_show_member1)
						{
							$initrows++;
					?>
                    	<td>
                    		<div id="avatar_id" style="position:relative; left:0px; top:0px; padding:5px 10px 0px 0px;">
                            	<?php
									if($q_show_member1->member_display){
								?>
                                	<img src="<?=base_url()?>km_resource/member_display/<?=$q_show_member1->member_display?>" width="48" height="45" alt="<?=$q_show_member1->nickname?>" style="background:#CCCCCC; padding:2px;"/>
                                <?php
								}
								else{
								?>
                                	<img src="<?=base_url()?>km_resource/member_display/null.png" width="48" height="45" alt="<?=$q_show_member1->nickname?>" style="background:#CCCCCC; padding:2px;"/>
                                <?php
								}
								?>
                            </div>
                            <div id="nickname" style="position:relative; top:0px; font-size:10px; width:46px; text-align:center; color:#10548B;"><?=$q_show_member1->nickname?></div>
                    	</td>
                    <?php
						if(($initrows)%4==0)
						{
							echo "</tr>";
						}
					}//end foreach
					?>
                    </table>
                </div>
                <!--close-->
  </div>
  <div id="side-panel-bottom"></div>
</div>
<!-- end km tool's -->

  </div>
  <!-- end left side-->
  
  <!-- right side-->
  <div class="grid_8 omega">
  
  <!-- km news -->
  	<div class="grid_8 alpha" style="margin-top:10px;">
  	<div id="km-new-top">
    	<div id="header_km_new" style="padding:7px; position:relative;">
        	<div id="h_text" style="font-weight:bold; color:#666666; position:absolute;">KM Organization News</div>
            <div id="h_more" style="font-size:11px;color:#FFFFFF; position:absolute; right:5px; -moz-border-radius-topleft: 4px;
-moz-border-radius-topright: 4px;
-moz-border-radius-bottomright: 4px;
-moz-border-radius-bottomleft: 4px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px; background:#009B4E; padding:3px;">read more..</div>
        </div>
    </div>
    
    <div id="km-new-middle">
    
    <ol>
    <?php
		$this->db->join('organization','organization.org_id=content_of_organization.org_id');
		$this->db->join('membership','membership.member_id=content_of_organization.member_id');
		$this->db->limit(4);
		$this->db->order_by('c_org_date','desc');
		$query_organization = $this->db->get('content_of_organization');
			$news=0;
		foreach($query_organization->result() as $q_org)
		{
			$news++;
	?>
    	<ul style="padding-bottom:35px;">
			<div id="km_content" style="position:relative;">
                <div id="ico_org" style="position:absolute;"><img src="./images/graphic/1294588753_newspaper.png"/></div>
                <div id="topic_news" style="position:absolute; top:0px; left:40px;"><a href="<?=base_url()?>/organization/view_details/<?=$q_org->c_org_id?>"><?=$q_org->c_org_title?></a><?php if($news==1){ ?>&nbsp;<img src="./images/graphic/ico_New2.gif"/><?php } ?></div>
                <div id="topic_details" style="position:absolute; top:15px; left:40px; font-size:10px; color:#666666;"><?=$q_org->c_org_date?> By <?=$q_org->firstname?>&nbsp;<?=$q_org->lastname?>&nbsp;(<?=$q_org->nickname?>)</div>
                <div id="category" style="position:absolute; padding:13px 0px 0px 5px; font-size:10px; font-weight:bold;"><?=$q_org->org_name?></div>
        	 </div>
        </ul>
     <?php
	 	}
	 ?>   
     </ol>
    
    </div>
    <div id="km-new-bottom"></div>
    </div>
  <!-- end km news -->
  
  <!-- blog -->
  <div class="grid_8 alpha" style="margin-top:8px;">
    <div id="blog-new-top">
    	<div id="header_km_new" style="padding:7px; position:relative;">
        	<div id="h_text" style="font-weight:bold; color:#666666; position:absolute;">New Blog</div>
            <div id="h_more" style="font-size:11px;color:#FFFFFF; position:absolute; right:5px; -moz-border-radius-topleft: 4px;
-moz-border-radius-topright: 4px;
-moz-border-radius-bottomright: 4px;
-moz-border-radius-bottomleft: 4px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px; background:#0099CC; padding:3px;">read more..</div>
        </div>
    </div>
    <div id="km-new-middle" style="height:auto;">
    	<ol>
    <?php
		$this->db->join('blog_category','blog_category.b_category_id=blog.b_category_id');
		$this->db->join('membership','membership.member_id=blog.blog_author');
		$this->db->limit(5);
		$this->db->order_by('blog_create_date','desc');
		$query_blog = $this->db->get('blog');
			$blog_last=0;
		foreach($query_blog->result() as $q_blog)
		{
			$blog_last++;
	?>
    	<li style="padding-bottom:60px; list-style:none;">
			<div id="km_content" style="position:relative;">
            	<div id="bg_avatar" style="position:absolute;"><img src="./images/graphic/background_avatar.png"/></div>
                <div id="blog_avatar" style="position:absolute; left:7px; top:5px;"><?php if($q_blog->member_display){ ?><img src="./km_resource/member_display/<?=$q_blog->member_display?>" width="47" height="47"/><?php }else{?>
                	<img src="./km_resource/member_display/null.png" width="48" height="47"/>
				<?php } ?></div>
                <div id="topic_blog" style="position:absolute; top:2px; left:60px;"><a href="<?=base_url()?>blog/<?=$q_blog->nickname?>/entry/<?=$q_blog->blog_id?>"><?=$q_blog->blog_entry_name?></a><?php if($blog_last==1){ ?>&nbsp;<img src="./images/graphic/ico_New2.gif"/><?php } ?></div>
                <div id="blog_details" style="position:absolute; top:18px; left:60px; font-size:10px; color:#666666;"><?=$q_blog->blog_create_date?> By <?=$q_blog->firstname?>&nbsp;<?=$q_blog->lastname?>&nbsp;(<?=$q_blog->nickname?>)</div>
                <div id="blog_category_name" style="position:absolute; left:60px; top:30px; font-size:11px;"><img src="./images/graphic/tag-small.png"/>&nbsp;<a href="<?=base_url()?>blog/category/<?=$q_blog->b_category_id?>"><?=$q_blog->category_name?></a></div>
        	 </div>
        </li>
     <?php
	 	}
	 ?>   
     </ol>
    </div>
    <div id="km-new-bottom"></div>
  </div>
  <!-- end blog -->
   
   <div class="grid_9 alpha" style="margin-top:8px;">
        <div class="grid_4 alpha" style="margin-top:8px;">
          <div id="p-top"></div>
          <div id="p-middle">
          <div>
          	   <ul>
        <?php 
                $this->db->limit(5);
                $this->db->order_by("group_id","desc"); 
                $query2 = $this->db->get('cops_group');
                foreach($query2->result() as $rows2)
                {
                ?>
                <li style="list-style:none;"><img src="<?=base_url()?>images/mini-more.png" style="vertical-align:middle;"/>&nbsp;<a href="<?=base_url()?>cops/groups/<?=$rows2->group_id?>"><?=$rows2->group_name?></a></li>        	
                <?php
                }
                ?>
        </ul>
          </div>
          </div>
          <div id="p-bottom">Cops</div>
        </div>

        <div class="grid_4 alpha" style="margin-top:8px;">
        <div id="p-top"></div>
        <div id="p-middle">
        <div>
        <ul>
        <?php 
                $this->db->limit(5);
                $this->db->order_by("c_org_id","desc"); 
                $query = $this->db->get('content_of_organization');
                foreach($query->result() as $rows)
                {
                ?>
                <li style="list-style:none;"><img src="<?=base_url()?>images/mini-more.png" style="vertical-align:middle;"/>&nbsp;<a href="<?=base_url()?>organization/view_details/<?=$rows->c_org_id?>"><?=$rows->c_org_title?></a></li>        	
                <?php
                }
                ?>
        </ul>
        </div>
        </div>
        <div id="p-bottom">Organization</div>
		</div>
</div>

  </div>
  <!-- end right side-->
</div>
<!-- end container -->
<div class="clear"></div>


<div class="grid_12" style="background-color:#CCCCCC;">&nbsp;</div>
<div class="clear"></div>
<!--footer-->
<div class="grid_12" id="footer" style="margin-bottom:20px;">&nbsp;</div>
<div class="clear"></div>
<div class="grid_12" align="center" style="margin-bottom:15px; font-size:x-small; color:#666666;">หน้านี้ใช้เวลาประมวลผล {elapsed_time} วินาที </div>
<!--end footer-->
</div>
<!--end container-->
</body>
</html>
